# -*- coding: utf-8 -*-

"""
@Datetime: 2018/8/4
@Author: Zhang Yafei
"""
import hashlib
import re


def get_md5(url):
    if isinstance(url,str):
        url = url.encode('utf-8')
    m = hashlib.md5()
    m.update(url)
    return m.hexdigest()


def extract_num(text):
    #从字符串中提取出数字
    match_re = re.match(".*?(\d+).*", text)
    if match_re:
        nums = int(match_re.group(1))
    else:
        nums = 0

    return nums


if __name__ == '__main__':
    url = input("请输入要加密的url地址:")
    print('md5:', get_md5(url))
